package com.wanmait.employment.manageController;

import com.github.pagehelper.PageInfo;
import com.wanmait.employment.entity.ProjectExperience;
import com.wanmait.employment.entity.Userinfo;
import com.wanmait.employment.mapper.ProjectExperienceMapper;
import com.wanmait.employment.service.ProjectExperienceService;
import com.wanmait.employment.util.AjaxResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/manage/ProjectExperience")

public class ProjectExperienceController {
    @Resource
    private ProjectExperienceService projectExperienceService;

    @GetMapping("list")
    public AjaxResult list(String title, Integer pageNum,Integer pageSize){
        PageInfo<ProjectExperience> projectExperiencePageInfo = projectExperienceService.selectList(title,pageNum,pageSize);
        return AjaxResult.success("",projectExperiencePageInfo);
    }
//    @PostMapping("update")
//    public AjaxResult update(@RequestBody ProjectExperience projectExperience){
//        if(projectExperience.getId()!=null){
//            projectExperienceService.update(projectExperience);
//            return AjaxResult.success("");
//        }
//        Boolean b = projectExperienceService.insert(projectExperience);
//        if(b){
//            return AjaxResult.success("");
//        }
//        return AjaxResult.error("已存在");
//    }
    @GetMapping("delete")
    public AjaxResult delete(Integer id){
        projectExperienceService.delete(id);
        return AjaxResult.success("");
    }

}
